<!--
 * @Author: liaoyu1992 1519778181@qq.com
 * @Date: 2022-11-08 14:52:04
 * @LastEditors: liaoyu1992 1519778181@qq.com
 * @LastEditTime: 2022-11-11 22:03:17
 * @FilePath: \kgantt\core\components\other\ViewSwitcher.vue
 * @Description: 模式切换
-->
<template>
  <div class="kgantt-ViewContainer">
    <button class="kgantt-Button" @click="() => onViewModeChange(ViewMode.Hour)">
      时
    </button>
    <button class="kgantt-Button" @click="() => onViewModeChange(ViewMode.QuarterDay)">
      6小时
    </button>
    <button class="kgantt-Button" @click="() => onViewModeChange(ViewMode.HalfDay)">
      12小时
    </button>
    <button class="kgantt-Button" @click="() => onViewModeChange(ViewMode.Day)">
      24小时
    </button>
    <button class="kgantt-Button" @click="() => onViewModeChange(ViewMode.Week)">
      周
    </button>
    <button class="kgantt-Button" @click="() => onViewModeChange(ViewMode.Month)">
      月
    </button>
    <button class="kgantt-Button" @click="() => onViewModeChange(ViewMode.Year)">
      年
    </button>
  </div>
</template>
<script lang="ts" setup>
import { ViewMode } from "../../types/publicTypes";

defineProps({
  isChecked: {
    type: Boolean,
    default: false,
  },
});
const emits = defineEmits(["onViewModeChange"]);
const onViewModeChange = (viewMode: ViewMode) => {
  emits("onViewModeChange", viewMode);
};
</script>
